package main

import "fmt"

// 接口
type animal interface {
	move()
	eat(foot string)
}

// 结构体
type cat struct {
	name string
}
type dog struct {
	name string
}

// 方法
func (d dog) move() {
	fmt.Println(d.name, "行驶中")
}
func (d dog) eat(foot string) {
	fmt.Println(d.name, "吃", foot)
}
func (c cat) move() {
	fmt.Println(c.name, "行驶中")
}
func (c cat) eat(foot string) {
	fmt.Println(c.name, "吃", foot)
}
func main() {
	var an animal
	c1 := cat{"喵"}
	an = c1
	an.eat("🐟")

	d1 := dog{"汪汪"}

	an = d1
	an.eat("骨头")
}
